Repository navigation
head gate: review trigger live check as a setup step, release note, warning on odd run fields (#379) - #650
Conversation
…arning on odd run fields (#379) Items 1 to 7 of #379 are on main (#392, #406). Item 8, the live check, needs a project that copies the trigger, so it becomes a written setup step (README step 8) and part of a new release-notes entry for the trigger, which every ci/v15+ release ships without one. A review run whose head fields are missing or odd now judges nothing with a ::warning:: instead of a plain log line, so a live mismatch of GitHub's fields is seen rather than staying green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review (lens B): SAFEHead What I checked
Minor
|
Review (lens A): SAFEHead What changed in code: one Is a normal event now classed as odd? Another event ( Items 1 to 7 of #379, checked on main:
All seven hold. ci/v15..ci/v19 ship the trigger: checked by file content. At each of these tags, Docs against the code:
Tests and mutants:
CI: State question:
Minor
Nits
🤖 Generated with Claude Code |
Fixes #379
Each point of #379, checked against current main
Items 1 to 7: already fixed on main, by head gate: #375 follow-ups (one head two PRs, docs, caller if, case test) #392 and head gate: #392 lens minors (docs wording, number-order tests) #406. I checked each one in the code, not only in the issue text:
review_run_prjudges once, under the lowest number, and logs the others.gate-trust.mdsay: to withdraw a lens read, post an issue comment or dispatch.ifhas the event clause.HEAD_JQhas three fields.head_gate.test.py.Nothing in this PR changes them.
Item 8 (the live check): not done here, and no longer worth keeping an issue open for. The reasons:
ci/v15and later (soci/v19) already ship head gate: re-run after reviews and inline review comments via workflow_run (#88) #375 and head gate: #375 follow-ups (one head two PRs, docs, caller if, case test) #392: theirhead_gate.py, both example files andfork-head-gate.ymlmatch main apart from one unrelated line. The "contains neither" came from an ancestry check, and main's history was rewritten after those merges, so that check says no either way.So this PR makes the check part of every project's rollout, and makes a failed check visible:
ci/v15ships the trigger with no entry. Moving a pin is the only time a project reads these notes. Its Upgrade says: move the pin first or in the same PR, then copy the trigger and the caller'sworkflow_run,ifandconcurrencyin one PR, then do the live check.head_gate.py: a review run whose head fields (sha, repository, branch) are missing or odd now judges nothing with a::warning::, not a plain log line. A real review run always has these fields, so this case means the lookup's assumption is wrong, and every review run would otherwise stay green while judging nothing. A run started by another event (normal with an older caller that lacks the event clause) stays a plain log line. The "Stops before start" list in the README names the case.Every existing refusal is kept. The only behaviour change is that one log line becomes a warning annotation. Exit code, outputs and what is judged or posted do not change.
Tests
fork-ci/actions/head-check/head_gate.test.py: 106 OK. The odd-fields test now also checks two things. Odd head fields give exactly one::warning::line. Another event gives no annotation, and no::error::appears in either case..github/scripts/fork-head-gate-workflow.test.py: all passed. Three new checks:head=owner:branchfilter and the fallback.head_gate.py's own text.workflow_run,if,concurrency, the old-pin refusal and setup step 8..github/scripts/fork-contracts.test.py: all passed..github/scripts/fork-gate-trust-docs.test.py: not run locally (a local guard refuses this script). The PR does not touch it, and CI runs it.vp fmt --checkon both changed Markdown files: clean.Red first: with the new tests and the old
head_gate.py, README and release notes, there were 7 failures inhead_gate.test.py(one per odd-field case) and 3 FAILs in the workflow test. All are green with the change.State question
ci/v15toci/v19keeps the plain log line until it moves its pin. The release note says from which release the warning appears.workflow_run. The note says that moving the pin alone breaks nothing.General vs project
🤖 Generated with Claude Code